package gui.detail.relation;

import exceptions.AttributeAlreadyInRelationException;
import gui.detail.AttributePanel;
import gui.detail.DetailPanel;
import gui.detail.relation.AttributeWidget;
import modeller.databasedesignmodel.Attribute;

import javax.swing.*;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * User: Jason Ye
 * Date: 02/02/2012
 * Time: 20:00

 */
public class RelationDetail extends DetailPanel {

    private AttributePanel attributesPanel;
    private JPanel relationSpecPanel;
    private JPanel indicesPanel;

    public RelationDetail() {

        attributesPanel=new AttributePanel();
        relationSpecPanel=new JPanel();
        indicesPanel=new JPanel();

        this.setLayout(new BorderLayout());

    }

    public void addAttribute(String attributeName, String attributeType, int newAttributeMaxSize) throws AttributeAlreadyInRelationException {

        attributesPanel.addAttributeWidget(attributeName, attributeType, newAttributeMaxSize);

        attributesPanel.revalidate();


    }




}
